package com.kvest.fortests.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class EmptyService extends Service {
    public static final String BROADCAST_ACTION = "com.kvest.fortests.empty_service.RESULT_BROADCAST_ACTION";
    public static final String ACTION_PARAM = "action";

    @Override
      public void onCreate() {
        super.onCreate();

        Intent intent = new Intent(BROADCAST_ACTION);
        intent.putExtra(ACTION_PARAM, "onCreate");
        sendBroadcast(intent);

        Log.d("KVEST_TAG", "create Empty service");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();

        Intent intent = new Intent(BROADCAST_ACTION);
        intent.putExtra(ACTION_PARAM, "onDestroy");
        sendBroadcast(intent);

        Log.d("KVEST_TAG", "destroy Empty service");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {

        Intent resultIntent = new Intent(BROADCAST_ACTION);
        resultIntent.putExtra(ACTION_PARAM, "onStartCommand");
        sendBroadcast(resultIntent);

        Log.d("KVEST_TAG", "start Empty service");

        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
